package cn.ayanami.blog.config;

import io.r2dbc.spi.ConnectionFactories;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import io.r2dbc.spi.ConnectionFactory;


@Configuration
public class DBConfig {

    @Value("${db.full-url}")
    private String jdbcUrl;

    @Bean
    public ConnectionFactory connectionFactory() {

        return ConnectionFactories.get(jdbcUrl);
    }

    // @Bean
    // public org.springframework.data.r2dbc.core.R2dbcEntityTemplate R2dbcEntityTemplate(){

    //     return new org.springframework.data.r2dbc.core.R2dbcEntityTemplate(connectionFactory());
    // }
}
